package com.example.skudemo.utils;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class DateUtils {
    /**
     * 获取当前时间戳
     *
     * @return
     */
    public static long getCurrentTime() {
        return System.currentTimeMillis();
    }

    public static Date currentDateAddDay(int day) {
        Date date = new Date();
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(date);
        calendar.add(calendar.DATE, day); //把日期往后增加几天,整数  往后推,负数往前移动
        date = calendar.getTime();
        return date;
    }
}
